using System;
using NUnit.Framework;
using System.Net;

using MIS.EN.Exchange.Entities;
using MIS.EN.Exchange;

namespace MIS.EN.UnitTests
{
    [TestFixture]
    public class ExchangeStoreTests
    {
        private NetworkCredential credentials;
        private Uri userMailBox;

        [SetUp]
        public void Init()
        {
            this.credentials = new NetworkCredential("LabAdmin", "Vertigo", "SalesForce");
            this.userMailBox = new Uri("http://10.0.3.166/exchange/johndoe");
        }

        [Test]
        public void CreateAppointment()
        {
            Appointment appointment = new Appointment("San Diego", DateTime.Parse("6/21/2006 11:30 AM"),
                DateTime.Parse("6/21/2006 12:30 PM"), InstanceType.Single, BusyStatus.Busy, 
                MeetingStatus.Confirmed, false, false, 900, "San Diego Meeting", "Meeting in San Diego", TimeZoneId.Pacific);
            ExchangeStore store = new ExchangeStore(this.credentials, this.userMailBox);
            store.SaveAppointment(appointment);
            // Check to see if the appointment was created by checking its Href property
            Assert.Greater(0, appointment.Href.ToString().Length);
        }
    }
}
